<?php if (!defined('THINK_PATH')) exit();?><!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<script type="text/javascript" src="__JS__/menu.js"></script>
<script type="text/javascript" src="__JS__/leftmenubar.js"></script>
<link rel="stylesheet" type="text/css" href="__CSS__/header.css" />
<script type="text/javascript" src="__JS__/jshelper.js"></script> 
<link rel="stylesheet" type="text/css" href="__CSS__/footer.css" />

	<title>课程管理</title>
		<script type="text/javascript" src="__JS__/jshelper.js"></script> 
			<script type="text/JavaScript">
				function courseedit(id){
					window.location.href="__URL__/courseedit/id/"+id;
				}
				function coursesearch(id){
					window.location.href="__URL__/coursedetail/id/"+id;
				}
				function coursedelete(id){
					if (confirm("你确定要删除吗")==true) 
						postwith('__URL__/coursedelete',{id:id});
				}
				function course(id)
				{
					postwith('__URL__/course',{id:id});
				}
				
				window.onload=show;
			</script>
</head>
<body>
<!-- layout::Auth:header::0 -->
<div class="nowposition">
当前位置：
<a href='__APP__/index/index'  class="nowpositionhref">主页</a>>
<a href='__URL__/index' class="nowpositionhref">后台管理</a>>
<a href="__URL__/coursedetail"  class="nowpositionhref">课程管理</a>
</div>	
<!-- layout::Auth:leftmenu::0 -->
<div class="coursedetail">
	<div align="left">
	<?php if($role != '教师'): ?><a href="__URL__/courseadd" style="font-size:17px; text-decoration:none; color:blue; font-weight:bold;">添加课程</a>
		<a href="__URL__/courseapprove" style="font-size:17px; text-decoration:none; color:blue; font-weight:bold;">课程认证</a><?php endif; ?>
	</div>
	<div align="left" style="margin-top:30px;">
		<form method="get" action="__URL__/coursedetail" >
			课程序号<input type="text" name="number">
			课程名称<input type="text" name="name">
			院系名称<select name="dname">
						<option value></option>						  
							<?php if(is_array($deplist)): $i = 0; $__LIST__ = $deplist;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$vo): ++$i;$mod = ($i % 2 )?><option value =	<?php echo ($vo["name"]); ?>><?php echo ($vo["name"]); ?></option><?php endforeach; endif; else: echo "" ;endif; ?>
					</select>
			<input type="submit" onClick="coursesearch(id)" value="查询">
		</form>
	</div>
			<div id="course_Show">
				<table border="0" align="center" cellpadding="0px" cellspacing="0px">
					<thead  >
						<tr align="left" style="height:35px; background-color:#f0f0f0;">
							<td style="width:150px">课程序号</td>
							<td style="width:150px">课程名称</td>
							<td style="width:150px">所属院系</td>
							<td style="width:50px">操作</td>
						</tr>
					</thead>
	<load href"__PUBLIC__/js/list_show.js">
	<tbody id="tab" align="left">
	<?php if(is_array($list)): $i = 0; $__LIST__ = $list;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$vo): ++$i;$mod = ($i % 2 )?><tr id="table_course_show" style="height:35px;">
		<td style="width:180px"><?php echo ($vo["number"]); ?></td><!--院系名称-->
		<?php if($vo["isselect"] != 0): ?><td style="width:180px"><strong><?php echo ($vo["name"]); ?> (已选择)</strong></td><!--课程名称-->
			<?php else: ?>
			<td style="width:180px"><?php echo ($vo["name"]); ?></td><!--课程名称--><?php endif; ?>
		
		<td style="width:180px"><?php echo ($vo["dname"]); ?></td><!--院系名称-->
		<td style="display:none;"><?php echo ($vo["id"]); ?></td><!--课程ID-->
		<td style="width:180px">
		<?php if($vo["isselect"] == 0): ?><a name="courseedit" onClick="course('<?php echo ($vo["id"]); ?>')" class="grey" href="#">选择</a>
			<!--<input type="button" name="courseedit"  onClick="course(<?php echo ($vo["id"]); ?>)" value="选择">-->
			<?php else: ?>
			<a name="courseedit" onClick="course('<?php echo ($vo["id"]); ?>')" class="fuchsia" href="#">取消</a>
			<!--<input type="button" name="courseedit"  onClick="course(<?php echo ($vo["id"]); ?>)" value="取消">--><?php endif; ?>
				<?php if($vo["select"] == 1): ?><a name="courseedit" onClick="courseedit('<?php echo ($vo["id"]); ?>')" class="blue" href="#">编辑</a><?php endif; ?>
				<?php if($role != '教师'): ?><a name="delete_course" onClick="coursedelete('<?php echo ($vo["id"]); ?>')" class="red" style="color:red"  href="#">删除</a><?php endif; ?>
		</td></tr><?php endforeach; endif; else: echo "" ;endif; ?>
		
	</tbody>		
</table>

</div>
<div class="green-black" align="right" style="width:82%"><?php echo ($page); ?></div>
</div>
</body>
</html>